package com.wjk.service;

import java.util.List;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wjk.Repository.CityRepository;
import com.wjk.entity.City;

@Service
public class CityService {

	@Autowired
	private CityRepository cityRepository;
	
	public List<City> findAll(){
		return cityRepository.findAll();
	}
	
	public City findById(Long id){
		
		return cityRepository.findById(id).get();
	}
}
